package com.gimi.cloud.jimi.dao.dao.userInfo;

import com.gimi.cloud.jimi.dao.dao.sys.BaseDao;
import com.gimi.cloud.jimi.dao.myMapper.MyMapper;
import com.gimi.cloud.jimi.dto.userInfo.RdFaceInfoDTO;
import com.gimi.cloud.jimi.entity.userInfo.RdFaceInfo;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RdFaceInfoDao extends MyMapper<RdFaceInfo>,BaseDao<RdFaceInfo, RdFaceInfoDTO> {

    @Select("select * from rd_face_info where user_id = #{userId} order by add_time desc limit 1")
    public RdFaceInfoDTO getFaceInfoByUser(Integer userId);

    @Select("SELECT * FROM rd_face_info WHERE report_effection_end > NOW() AND status = 0 AND user_id = #{userId} limit 1")
	RdFaceInfoDTO isEffection(@Param(value = "userId") Integer userId);
    
}
